#include <iostream>
#include <string>
using namespace std;

class Student {
public:
    Student(){};
    Student(int nu, string na, int sc) : num(nu), name(na), score(sc){}
    Student(int nu, string na, char se) : num(nu), name(na), sex(se){}
protected:
    int num;
    string name;
    int score;
    char sex;
};

class Student1 : public Student {
public:
    Student1(){}
    void input()
    {
        cin >> num >> name >> score >> addr;
        //Student(num, name, score);
    }
    void show()
    {
        cout << "num = " << num << " name = " << name;
        cout << " score = " << score << " addr = " << addr << endl;
    }
private:
    string addr;
};

class Student2 : private Student {
public:
    Student2(){}
    void input()
    {
        cin >> num >> name >> score >> sex >> addr;
    }
    void show()
    {
        cout << "num = " << num << " name = " << name << " sex = " << sex;
        cout << " score = " << score << " addr = " << addr << endl;
    }
private:
    string addr;
    char sex;
};

class Student3 : protected Student {
public:
    Student3(){};
    Student3(int nu, string na, char se, int ag, string add) : Student(nu, na, se)
    {
        age = ag;
        addr = add;
    }
    void show()
    {
        cout << "num = " << num << " name = " << name << " sex = " << sex << endl;
        cout << " age = " << age << " addr = " << addr << endl;
    }
private:
    int age;
    string addr;
};

class Student4 : public Student {
public:
    Student4(){};
    Student4(int nu, string na, char se, int ag, string add) : Student(nu, na, se)
    {
        age = ag;
        addr = add;
    }
    void show()
    {
        cout << "num = " << num << " name = " << name << " sex = " << sex << endl;
        cout << " age = " << age << " addr = " << addr << endl;
    }
private:
    int age;
    string addr;
};

class Base {
public:
    Base(){a= 0, b = 0;}
    Base(int i) {a = i, b = 0;};
    Base(int i, int j) {a = i, b = j;}
    void show()
    {
        cout << "a = " << a << " b = " << b;
    }
private:
    int a;
    int b;
};
class Child : public Base {
public:
    Child(){c = 0;}
    Child(int i) : Base(i) {c = 0;}
    Child(int i, int j) : Base(i, j) {c = 0;}
    Child(int i, int j, int k) : Base(i, j) {c = k;}
    void show1()
    {
        show();
        cout << " c = " << c << endl;
    }   
private:
    int c;
};

class Base1 {
public:
    Base1()
    {
        cout << "this is Base1" << endl;
    }
    ~Base1()
    {
        cout << "this is ~Base1" << endl;
    }
};
class Child2 : public Base1 {
public:
    Child2()
    {
        cout << "this is Child2" << endl;
    }
    ~Child2()
    {
        cout << "this is ~Child2" << endl;
    }
};
class Child3 : public Child2 {
public:
    Child3()
    {
        cout << "this is Child3" << endl;
    }
    ~Child3()
    {
        cout << "this is ~Child3" << endl;
    }
};
class Teacher {
public:
    void display()
    {
        cout << "name = " << name << " age = " << age << " sex = " << sex;
        cout << " addr = " << addr << "num = " << num << " title = " << title << endl;
    }
protected:
    string name;
    int age;
    char sex;
    string addr;
    int num;
    char title;
};

class Cadre {
public:
    void display()
    {
        cout << "name = " << name << " age = " << age << " sex = " << sex;
        cout << " addr = " << addr << "num = " << num << "post" << post << endl;
    }
protected:
    string name;
    int age;
    char sex;
    string addr;
    int num;
    char post;
};

class Teacher_Cadre : public Teacher, public Cadre {
public:
    Teacher_Cadre()
    {}
    void input();
    void show();
private:
    string name;
    int age;
    char sex;
    string addr;
    int num;
    int wage;
};

class Birthday {
public:
    Birthday(){};
    Birthday(int y, int m, int d)
    {
        year = y;
        month = m;
        day = d;
    }
    ~Birthday(){};
    void modify(int y, int m, int d)
    {
        year = y;
        month = m;
        day = d;
    }
    void show()
    {
        cout << "year = " << year << " month = " << month << " day = " << day << endl;
    }
private:
    int year;
    int month;
    int day;
};

class Profess {
public:
    Profess(Birthday d, int nu, string na, char se)
    {
        day = d;
        num = nu;
        name = na;
        sex = se;
    }
    ~Profess(){};
    void show()
    {
        day.show();
        cout << "num = " << num << " name = " << name << " sex = " << sex << endl;
    }
private:
    Birthday day;
    int num;
    string name;
    char sex;
};